package com.chenchao.javaoop;
import static java.lang.Math.random;
//静态导入包System.out.println(random());
//
/**
 * @encoding : UTF-8
 * @Time : 2020/11/8 14:53
 * @Author : Chen Chao
 * @File : javaSE.com.chenchao.javaoop.B.java
 * @Software : IntelliJ IDEA
 * @since : 1.8
 */
class A{
    public A()
    {
        System.out.println("1.A类的构造方法");
    }
    {
        System.out.println("2.A类的构造块");
    }
    static{
        System.out.println("3.A类的静态方法");
    }
}
class C extends A{

}
public class B extends A{
    public B()
    {
        System.out.println("4.B类的构造方法");
    }
    {
        System.out.println("5.B类的构造块");
    }
    static{
        System.out.println("6.B类的静态方法");
    }
    public static void main(String[] args)
    {
        System.out.println("7.start......");
        B b=new B();
        A a=new A();
        System.out.println("8.end.....");
        C c=new C();
        //System.out.println(a instanceof C);//false
        //C的父类对象a可以向下转型成C,可以编译通过，结果为false
        System.out.println(random());
        System.out.println(new C());

    }
}
